{% if pages|length > 0  %}
<ul class="pure-paginator">
    {% for p,v in pages %}
    <li>
        {% if v=='current' %}
                <a href="#" class="pure-button pure-button-active">{{ p }}</a>
        {% elseif v=='first' %}
            <a class="pure-button" href="{{ url }}?page={{ p }}" rel="first">首页</a>
        {% elseif v=='last' %}
            <a class="pure-button" href="{{ url }}?page={{ p }}" rel="last">末页</a>
        {% else %}
            <a class="pure-button{{ p==page+1 ? ' next':'' }}{{ p==page-1 ? ' prev':'' }}" href="{{ url }}?page={{ p }}" rel="{{ p==page+1 ? 'next':'' }}{{ p==page-1 ? 'prev':'' }}">{{ p }}</a>
        {% endif %}
    </li>
    {% endfor %}
</ul>
{% endif %}